/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package RMI;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;


public class ServicosCliente{
    private static ServicosIF servicos;


    
    public static ServicosIF getInstance() {
        if (servicos == null) {
            try {
                Registry registro = LocateRegistry.getRegistry("rmi://localhost", 1099);
                servicos = (ServicosIF) Naming.lookup("rmi://localhost:1099/hoteishilton");
            }
            catch (NotBoundException e) {
                e.printStackTrace();
            }
            catch (MalformedURLException e) {
                e.printStackTrace();
            }
            catch (Exception e) {
                e.printStackTrace();
            }
        }
            
        return servicos;
    }
    


}
